package com.simtop.dao;

import com.simtop.pojo.User;
import com.simtop.vo.TeamType;
import com.simtop.vo.UserVoS;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.python.antlr.op.In;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface UserDao {

    int checkLoginName(String loginName);

    int checkEmail(String email);

    int insert(User user);

    int insert2(UserVoS userVoS);

    User checkLoginNameOrEmail(@Param("loginName") String loginName);

    int updatePasswordByEmail(User user);

    List<User> selectAll(User user);

    int insertBackUser(User user);

    int deleteByUserId(Integer id);

    int updateBackendUser(User user);

    List<User> selectByParams(User user);

    int selectUserCounts();

    User findById(Integer id);

    User findByLoginName(String loginName);

    int inserIlabUser(User user);

    /**
     * 统计各个省份对应的人数
     * @return
     */
    public List<Map<String,Integer>> getProvinceCount();

    /**
     * 统计各个角色对应的人数
     * @return
     */
    public List<Map<String,Integer>> getRoleCount();

    /**
     * 修改用户名
     * @param loginName
     * @param userName
     * @return
     */
    boolean updateUserName(@Param("loginName") String loginName,@Param("userName") String userName);

    List<User> findAlls();

    String findImage(@Param("id") Integer id);

    List<UserVoS> findAllList(@Param("tameName") String tameName , @Param("userName") String userName);

    List<UserVoS> findAllList2(@Param("tameName") String tameName);

    void deletefindAllList(@Param("sqsyidlist") ArrayList<Integer> sqsyidlist);

    List<TeamType> findAllListTeam();

    List<TeamType> findtam();

    void insertAllListTeam(@Param("teamName") String teamName);

    void deleteAllListTeam(@Param("id") Integer id);

    int finOnly(@Param("id") Integer id);

    void updateAllListTeam(@Param("id") Integer id,@Param("teamName") String teamName);

    void savetime(@Param("date") Date date, @Param("id") Integer id);

    Integer getcount(@Param("id") Integer id);

    void savelastcountid(@Param("lastcountid") Integer lastcountid , @Param("id") Integer id);

    void saveip(@Param("hostAddress") String hostAddress, @Param("id") Integer id);

    void savestatus(@Param("id") Integer id);

    Date findcreateTime(Integer id);

    void savelasttime(@Param("lastst") Integer lastst,@Param("id") Integer id);

    int finOneTime(@Param("id") Integer id);

    void deletefindAllListas(@Param("sqsyidlist") ArrayList<Integer> sqsyidlist);
    Integer updateLastTime(@Param("id")Integer id);
}
